package com.lzmpt.imchat.base;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.lzmpt.imchat.R;
import com.lzmpt.imchat.ui.BaseActivity;

public abstract class BaseChatActivity extends BaseActivity {

    private TextView title;
    private ImageView mRightImg;
    private ImageView mLeftImg;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getDataBefor();
        setContentView(initLayout());
        initTitleView();
        initView();
        setUpView();
    }

    public Activity getActivity() {
        return this;
    }

    /**
     * 获取界面传来的参数等
     */
    protected void getDataBefor() {

    }

    protected abstract void setUpView();

    protected abstract void initView();

    public void initTitleView() {
        title = findViewById(R.id.tv_title_bar);
        mRightImg = findViewById(R.id.img_title_right);
        mLeftImg = findViewById(R.id.img_title_left);
    }


    public abstract int initLayout();

    public void setTitle(String mTitle) {
        title.setText(mTitle);
    }

    public void setmLeftClick(View.OnClickListener l) {
        mLeftImg.setOnClickListener(l);
    }

    public void setmRightClick(View.OnClickListener l) {
        mRightImg.setOnClickListener(l);
    }



}
